{% extends 'CHOMPSGIBundle::chompBaseTemplate.html.twig' %}

{% block title %}Alta Empresa{% endblock %}

{% block body %}

	<script type="text/javascript" src="{{ asset('bundles/chompsgi/js/livevalidation_standalone.compressed.js') }}" ></script>
	<style>

		.formContainer{
			background-color: #ddd;
			border: solid 1px #808080
			-webkit-border-radius: 10px;
			-moz-border-radius: 10px;
			border-radius: 10px;
			padding: 20px;
		}

		.LV_valid {
		    background-image: url("/web/bundles/chompsgi/img/right.png");
		    background-position: 5px -3px;
		    background-repeat: no-repeat;
		    background-size: 20px 20px;
		    color: rgba(0, 0, 0, 0);
		    height: 30px;
		    overflow: hidden;
		    text-indent: 100%;
		    width: 30px;
		    padding: 1px;
    	}

		.LV_invalid {
		    background-image: url("/web/bundles/chompsgi/img/wrong.png");
		    background-position: 5px 0;
		    background-repeat: no-repeat;
		    background-size: 20px 20px;
		    color: rgba(0, 0, 0, 0);
		    overflow: hidden;
		    padding: 1px;
		    text-indent: 100%;
		    width: 40px;
		}

		.LV_valid_field,
		input.LV_valid_field:hover, 
		input.LV_valid_field:active,
		textarea.LV_valid_field:hover,  
		textarea.LV_valid_field:active {
		    border: 1px solid #74DF00 !important;
		    /*border: 2px solid #acd58a !important;*/
		    
		}
		    
		.LV_invalid_field, 
		input.LV_invalid_field:hover, 
		input.LV_invalid_field:active,
		textarea.LV_invalid_field:hover, 
		textarea.LV_invalid_field:active {
		    border: 1px solid #b42121!important;
		}

		.formLine{
			margin: 5px 0;
			height: 40px;
		}

	</style>
	<div class="content">
		<h1>Alta de Empresa</h1>	

		<div class="span10 formContainer">
			<form id="theForm" action="#" method="post" action="<?php echo url_for('Empresa/save') ?>">
				<div class="span8 offset2">
					<div class="row-fluid "> 
						<div class="formLine">
							<div class="span6 label">Nombre: </div>
							<div class="span6"><input type="text" id="fNombre" value=""></div>
						</div>
					</div>
					<div class="row-fluid ">
						<div class="formLine">
							<div class="span6 label">Descripci&oacute;n:</div>
							<div class="span6"><input type="text" id="fDescrip" value=""></div>
						</div>
					 </div>
					<div class="row-fluid"> 
						<div class="formLine">
							<div class="span6 label">Direcci&oacute;n:</div>
							<div class="span6"><input type="text" id="fDire" value=""></div>
						</div>
					</div>
					<div class="row-fluid"> 
						<div class="formLine">
							<div class="span6 label">Tel&eacute;fono:</div>
							<div class="span6"><input type="text" id="fTel" value=""></div>
						</div>
					</div>
				</div>
				<div class="row-fluid span12">
					<div class="span2 pull-right">
						<input type="submit" class="btn" value="Guardar" />
					</div>
				</div>
			</form>
		</div>

		<script>
			var nomValidator = new LiveValidation( "fNombre", { validMessage: "Ok", wait: 0 }); 
			nomValidator.add( Validate.Presence,{ failureMessage: "....." } );
			var descValidator = new LiveValidation( "fDescrip", { validMessage: "Ok", wait: 0 }); 
			descValidator.add( Validate.Presence,{ failureMessage: "....." } );
			var dirValidator = new LiveValidation( "fDire", { validMessage: "Ok", wait: 0 }); 
			dirValidator.add( Validate.Presence,{ failureMessage: "....." } );
			var telValidator = new LiveValidation( "fTel", { validMessage: "Ok", wait: 0 }); 
			telValidator.add( Validate.Presence,{ failureMessage: "....." } );
		</script>
	</div>

{% endblock %}